package com.china08.yxyapi.security.profile;

import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.pac4j.jwt.profile.JwtProfile;

/**
 * 云平台基础Profile
 * 
 * @author Ertao.Fang
 *
 */
public class YxyProfile extends JwtProfile {

    /**
     * 获取:当前角色:ID
     * 
     * @return
     */
    public String getRoleId() {
        return ObjectUtils.defaultIfNull(this.getAttribute("roleId"), "").toString();
    }

    /**
     * 设置:当前角色:ID
     * 
     * @param roleId
     */
    public void setRoleId(String roleId) {
        this.addAttribute("roleId", roleId);
    }

    /**
     * 获取:当前角色:名称
     * 
     * @return
     */
    public String getRoleName() {
        return ObjectUtils.defaultIfNull(this.getAttribute("roleName"), "").toString();
    }

    /**
     * 获取:当前角色:名称
     * 
     * @param roleName
     */
    public void setRoleName(String roleName) {
        this.addAttribute("roleName", roleName);
    }

    /**
     * 获取:当前学校地址
     * 
     * @return
     */
    public String getSchoolAddress() {
        return ObjectUtils.defaultIfNull(this.getAttribute("address"), "").toString();
    }

    /**
     * 设置:当前学校地址
     * 
     * @param schoolId
     */
    public void setSchoolAddress(String schoolAddress) {
        this.addAttribute("address", schoolAddress);
    }

    /**
     * 获取:当前学校:ID
     * 
     * @return
     */
    public String getSchoolId() {
        return ObjectUtils.defaultIfNull(this.getAttribute("schoolId"), "").toString();
    }

    /**
     * 设置:当前学校:ID
     * 
     * @param schoolId
     */
    public void setSchoolId(String schoolId) {
        this.addAttribute("schoolId", schoolId);
    }

    /**
     * 获取:当前学校:名称
     * 
     * @return
     */
    public String getSchoolName() {
        return ObjectUtils.defaultIfNull(this.getAttribute("schoolName"), "").toString();
    }

    /**
     * 设置:当前学校:名称
     * 
     * @param schoolName
     */
    public void setSchoolName(String schoolName) {
        this.addAttribute("schoolName", schoolName);
        this.addAttribute("schoolNick", schoolName);
    }

    /**
     * 获取:当前学校:地区:省:ID
     * 
     * @return
     */
    public String getSchoolAreaIdProvince() {
        return ObjectUtils.defaultIfNull(this.getAttribute("schoolAreaIdProvince"), "").toString();
    }

    /**
     * 设置:当前学校:地区:ID:省
     * 
     * @param schoolAreaIdProvince
     */
    public void setSchoolAreaIdProvince(String schoolAreaIdProvince) {
        this.addAttribute("schoolAreaIdProvince", schoolAreaIdProvince);
    }

    /**
     * 获取:当前学校:地区:ID:市
     * 
     * @return
     */
    public String getSchoolAreaIdCity() {
        return ObjectUtils.defaultIfNull(this.getAttribute("schoolAreaIdCity"), "").toString();
    }

    /**
     * 设置:当前学校:地区:ID:市
     * 
     * @param schoolAreaIdCity
     */
    public void setSchoolAreaIdCity(String schoolAreaIdCity) {
        this.addAttribute("schoolAreaIdCity", schoolAreaIdCity);
    }

    /**
     * 获取:当前学校:地区:ID:区县
     * 
     * @return
     */
    public String getSchoolAreaIdDistrict() {
        return ObjectUtils.defaultIfNull(this.getAttribute("schoolAreaIdDistrict"), "").toString();
    }

    /**
     * 设置:当前学校:地区:ID:区县
     * 
     * @param schoolAreaIdDistrict
     */
    public void setSchoolAreaIdDistrict(String schoolAreaIdDistrict) {
        this.addAttribute("schoolAreaIdDistrict", schoolAreaIdDistrict);
    }

    /**
     * 获取:当前学校:是否教育局
     * 
     * @return
     */
    public Boolean getSchoolIsBureau() {
        return BooleanUtils.toBoolean(this.getAttribute("schoolIsBureau") + "");
    }

    /**
     * 设置:当前学校:是否教育局
     * 
     * @param schoolIsBureau
     */
    public void setSchoolIsBureau(Boolean schoolIsBureau) {
        this.addAttribute("schoolIsBureau", schoolIsBureau);
    }

    /**
     * 获取:当前学校:教育局级别
     * 
     * @return
     */
    public Integer getSchoolBureauLevel() {
        return NumberUtils.toInt(this.getAttribute("schoolBureauLevel") + "");
    }

    /**
     * 设置:当前学校:教育局级别
     * 
     * @param schoolBureauLevel
     */
    public void setSchoolBureauLevel(Integer schoolBureauLevel) {
        this.addAttribute("schoolBureauLevel", schoolBureauLevel);
    }

    /**
     * 获取:当前用户:昵称
     * 
     * @return
     */
    public String getUserNick() {
        return ObjectUtils.defaultIfNull(this.getAttribute("userNick"), "").toString();
    }

    /**
     * 设置:当前用户:昵称
     * 
     * @param userNick
     */
    public void setUserNick(String userNick) {
        this.addAttribute("userNick", userNick);
    }

    /**
     * 获取:当前用户:头像
     * 
     * @return
     */
    public String getUserAvator() {
        return ObjectUtils.defaultIfNull(this.getAttribute("userAvator"), "").toString();
    }

    /**
     * 设置:当前用户:头像
     * 
     * @param userAvator
     */
    public void setUserAvator(String userAvator) {
        this.addAttribute("userAvator", userAvator);
    }

    /**
     * 获取个人vip
     * 
     * @return
     */
    public String getUserVip() {
        return ObjectUtils.defaultIfNull(this.getAttribute("userVip"), "").toString();
    }

    /**
     * 设置个人vip
     * 
     * @param userAvator
     */
    public void setUserVip(String userVip) {
        this.addAttribute("userVip", userVip);
    }

    /**
     * 获取资源vip
     * 
     * @return
     */
    public String getResVip() {
        return ObjectUtils.defaultIfNull(this.getAttribute("resVip"), "").toString();
    }

    /**
     * 设置资源vip
     * 
     * @param userAvator
     */
    public void setResVip(String resVip) {
        this.addAttribute("resVip", resVip);
    }

    /**
     * 模板vip
     * 
     * @return
     */
    public String getTemVip() {
        return ObjectUtils.defaultIfNull(this.getAttribute("temVip"), "").toString();
    }

    /**
     * 设置模板vip
     * 
     * @param userAvator
     */
    public void setTemVip(String temVip) {
        this.addAttribute("temVip", temVip);
    }

    /**
     * 个人vip
     * 
     * @return
     */
    public String getPerVip() {
        return ObjectUtils.defaultIfNull(this.getAttribute("perVip"), "").toString();
    }

    /**
     * 个人vip
     * 
     * @param userAvator
     */
    public void setPerVip(String perVip) {
        this.addAttribute("perVip", perVip);
    }
}
